﻿using System.Web.Mvc;
using Downloader.Domain;
using Downloader.Domain.Contracts.Tasks;
using Downloader.Domain.QueryParams;
using Downloader.Web.Controllers.Queries;
using Downloader.Web.Controllers.ViewModels;

namespace Downloader.Web.Controllers
{
    public class HomeController : Controller
    {
        public IArticleQuery ArticleQuery { get; set; }
        public ICategoryTasks CategoryTasks { get; set; }
        public IArticleContentTasks ArticleContentTasks { get; set; }
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult About(ArticleQueryParams query)
        {

            var result = ArticleQuery.GetArticleByUrlName(query);
            return PartialView(result);
        }



        public ActionResult PubliceNotice(int key)
        {
            var temp = ArticleContentTasks.Get(key);
            var result = new ArticleContentViewModel(temp);
            return PartialView(result);
        }

    }
}
